home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Peter Lewis / PNL Libraries / Assembly / MenuSharing.p < prev    next >
Encoding:
Text File  |  1993-11-23  |  1.6 KB  |  62 lines  |  [TEXT/PJMM]

  1. { © copyright 1991-93 UserLand Software, Inc. All RIghts Reserved. }
  2. { © copyright 1993 Peter N Lewis - converted to Pascal, 22/11/93 }
  3.  
  4. unit MenuSharingToolKit;
  5.  
  6. interface
  7.  
  8.     uses
  9.         AppleEvents, Components;
  10.  
  11.     type
  12.         tysharedmenurecord = record
  13.                 idmenu: integer;
  14.                 flags: integer; {flhierarchic,flinserted}
  15.                 hmenu: MenuHandle;
  16.             end;
  17.  
  18.         tymenuarray = array[0..100] of tysharedmenurecord;
  19.         ptrmenuarray = ^tymenuarray;
  20.         hdlmenuarray = ^ptrmenuarray;
  21.  
  22.         tyMSerrordialog = ProcPtr;
  23. {procedure tyMSerrordialog(s:str255)}
  24.  
  25.         tyMSeventfilter = ProcPtr;
  26. {procedure tyMSeventfilter(var er:EventRecord);}
  27.  
  28.     type
  29.         tyMSglobals = record
  30.                 severid: OSType;
  31.                 clientid: OSType;
  32.                 hsharedmenus: hdlmenuarray;
  33.                 fldirtysharedmenus: boolean;
  34.                 flscriptcancelled: boolean;
  35.                 flscriptrunning: boolean;
  36.                 flinitialized: boolean;
  37.                 idscript: longInt;
  38.                 menuserver: ComponentInstance;
  39.                 scripterrorcallback: tyMSerrordialog;
  40.                 eventfiltercallback: tyMSeventfilter;
  41.             end;
  42.  
  43. {$J+}
  44.     var
  45.         theitemMSglobals: tyMSglobals;
  46. {$J-}
  47.  
  48.     function InitSharedMenus (errordialog: tyMSerrordialog; eventfilter: tyMSeventfilter): boolean;
  49.     function SharedMenuHit (themenu, theitem: integer): boolean;
  50.     function SharedScriptRunning: boolean;
  51.     function CancelSharedScript: boolean;
  52.     function CheckSharedMenus (themenu: integer): boolean;
  53.     function SharedScriptCancelled (event, reply: AppleEvent): boolean;
  54.  
  55.     function DisposeSharedMenus: boolean;
  56.     function IsSharedMenu (themenu: integer): boolean;
  57.     function EnableSharedMenus (enable: boolean): boolean;
  58.     function RunSharedMenuItem (themenu, theitem: integer): boolean;
  59.  
  60. implementation
  61.  
  62. end.